package com.demo.annotation.app.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

@Component
public class PayEntity implements BeanPostProcessor,BeanNameAware {

    public PayEntity(){
        System.out.println(">>>>>>>>>>>>1、PayEntity=============>>construct");
    }


    @Override
    public  Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {

        System.out.println(">>>>>>>>>>>>3、PayEntity=============>>Aware ->BeanPostProcessor postProcessBeforeInitialization :  "+beanName);

        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }


    @Override
    public void setBeanName(String beanName) {
        System.out.println(">>>>>>>>>>>>2、PayEntity=============>>Aware ->BeanNameAware setBeanName :  "+beanName);
    }
}
